package swing;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;

public class Ss {

	private JFrame frame;
	private JTextField textField;
	private JPasswordField passwordField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Ss window = new Ss();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Ss() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBackground(Color.PINK);
		frame.getContentPane().setBackground(Color.PINK);
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JLabel label = new JLabel("用户名");
		label.setBounds(51, 20, 54, 15);
		frame.getContentPane().add(label);
		
		JLabel label_1 = new JLabel("密码");
		label_1.setBounds(51, 45, 41, 15);
		frame.getContentPane().add(label_1);
		
		textField = new JTextField();
		textField.setBackground(new Color(255, 250, 250));
		textField.setFont(new Font("宋体", Font.PLAIN, 14));
		textField.setForeground(Color.DARK_GRAY);
		textField.setBounds(102, 17, 229, 21);
		frame.getContentPane().add(textField);
		textField.setColumns(10);
		
		passwordField = new JPasswordField();
		passwordField.setBackground(new Color(255, 250, 250));
		passwordField.setFont(new Font("宋体", Font.PLAIN, 14));
		passwordField.setForeground(Color.GRAY);
		passwordField.setBounds(102, 42, 229, 21);
		frame.getContentPane().add(passwordField);
		
		JButton button = new JButton("登录");
		button.setForeground(new Color(220, 20, 60));
		button.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			}
		});
		button.setToolTipText("点击登录");
		button.setBounds(102, 93, 93, 23);
		frame.getContentPane().add(button);
		
		JButton button_1 = new JButton("重置");
		button_1.setForeground(new Color(178, 34, 34));
		button_1.setToolTipText("点击重置");
		button_1.setBounds(238, 93, 93, 23);
		frame.getContentPane().add(button_1);
	}
}
